#pragma once
#include "../common/MyMatrix.hpp"
#include "../common/_3D_Vector.h"

#ifndef Vertex3f
#define Vertex3f _3D_Vector
#endif

#ifndef Normal3f
#define Normal3f _3D_Vector
#endif

#ifndef Color3f
#define Color3f _3D_Vector
#endif

class Vertex
{
private:
  Vertex3f _Pos;
  Array< Normal3f > _Normals;
  Normal3f _Normal;
  Normal3f _Normal_Before_Smooth;
  Color3f _color;

public:
  Vertex () {}
  Vertex (float x, float y, float z);

  void set (float x, float y, float z);
  void set_color (float r, float g, float b);

  const float* position () const;
  const float* color () const;
  const float* normal () const;
  float& operator[] (int i) const { return _Pos[i]; }

  void change_normal (MyMatrix< Vertex >& vertexs);
  void smooth_normal (MyMatrix< Vertex >& vertexs);
};